from base.base import Base
from time import sleep
from selenium.webdriver.common.by import By


class SouSuoPage(Base):

    sousuo = (By.ID,'com.kongfz.app:id/ll_search')

    sousuoshurukuang = (By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.RelativeLayout[1]/android.widget.RelativeLayout[2]/android.widget.EditText')

    sousuoanniu = 'new UiSelector().text("搜索")'

    dy = 'new UiSelector().text("查看全部")'


    def sousuoyewu(self):
        self.loc_ele(self.sousuo).click()
        sleep(4)
        self.loc_ele(self.sousuoshurukuang).send_keys("红楼梦")
        sleep(4)
        self.loc_ui_ele(self.sousuoanniu).click()
        sleep(4)